/*
 ============================================================================
 Name		: YuebaoFavoriteCanvasMyAccountContentPanel.h
 Author	  : wangchao
 Version	 : 1.0
 Copyright   :
 Description : MyAccountContentPanel declaration
 ============================================================================
 */

#ifndef YUEBAOFAVORITECANVASMyAccountContentPanel_H
#define YUEBAOFAVORITECANVASMyAccountContentPanel_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "YuebaoTabControl.h"
#include "fFramework.h"
#include "InputNumberDlg.h"
#include "HttpEngine.h"
#include "YuebaoFavoriteTabControl.h"

// CLASS DECLARATION
class MyAccountListboxContentControl;
class NetworkEngine;
class CResponseBanks;
class BanksListboxDlg;
class InputNumberDlg;

/**
 *  MyAccountContentPanel
 *
 */
class MyAccountContentPanel : public fTabContentControl,
        public fTabControlObserver,
        public fListboxEventObserver,
        public HttpEngineObserver,
        public MDialogEventObserver
{
public:
    // Constructors and destructor

    /**
     * Destructor.
     */
    ~MyAccountContentPanel( );

    /**
     * Two-phased constructor.
     */
    static MyAccountContentPanel* NewL( fEngine * aEngine, TRect rect );

    /**
     * Two-phased constructor.
     */
    static MyAccountContentPanel* NewLC( fEngine * aEngine, TRect rect );

private:

    /**
     * Constructor for performing 1st stage construction
     */
    MyAccountContentPanel( );

    /**
     * EPOC default constructor for performing 2nd stage construction
     */
    void ConstructL( fEngine * aEngine, TRect rect );
public:
    virtual void TabChanged( int active_index, int deactive_index );
    virtual void TabNotHandleKeyEvent( f_KEY_DES * aKeyDes );

    virtual void Active( );
    virtual void Deactive( );

    virtual void GetFocused( );
    virtual void LostFocuse( );
public:
    virtual void RenderFrame( );
    virtual void HandleKey( f_KEY_DES * aKeyDes );
    TInt HandleMouse( fMouseEvent nType, TPoint sPoint );
protected:
    YuebaoFavoriteTabControl* _tabControl;
    MyAccountListboxContentControl* _balanceAmount_listbox;
    MyAccountListboxContentControl* _pointsInquir_listbox;
    MyAccountListboxContentControl* _recommendedQuery_listbox;
    MyAccountListboxContentControl* _rechargeRecord_listbox;
protected:
    void ListboxItemClicked( fListbox* pListBox, int selectIndex, fListBoxItem* pItemInfo );
protected:
    CHttpEngine* _httpEngine;
protected:

    void HttpFinished( const CHttpEngine& engine, int finishedReason, const TDesC8& aBodyData );
    char* HttpEngineObserverID( )
    {
        return "accountContentPanel";
    }
private:
    enum TSavePointsStep
    {
        ENotReady, EGetBanks, EGetBanksUrl, EFinished,
    };

    TSavePointsStep _savePointsStep;

    CResponseBanks* _banks;

    BanksListboxDlg* _bankListDlg;
    InputNumberDlg* _inputNumberDlg;
protected:
    void HandleReturnEvent( fDialog* aObject, TReturnValue aValue );
public:
    fToolbar* _commandbar;
private:
    bool _gotUserInformation[4];
};

#endif // YUEBAOFAVORITECANVASMyAccountContentPanel_H
